package lzk.myshop.dao;

import lzk.myshop.pojo.Classify;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClassifyMapper {

    @Select("select * from classify where `merchantid` = #{merchantid}")
    List<Classify> allClassify(int merchantid);

    @Insert("insert into `classify` (`name`,`merchantid`) values (#{name},#{merchantid})")
    int addClassify(Classify classify);

    @Delete("DELETE FROM classify WHERE `id` = #{id}")
    int deleteClassify(int id);
}
